package com.ruoyi.hhsw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.hhsw.mapper.PlanNodeMapper;
import com.ruoyi.hhsw.domain.PlanNode;
import com.ruoyi.hhsw.service.IPlanNodeService;

/**
 * 进度节点Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-17
 */
@Service
public class PlanNodeServiceImpl implements IPlanNodeService 
{
    @Autowired
    private PlanNodeMapper planNodeMapper;

    /**
     * 查询进度节点
     * 
     * @param id 进度节点主键
     * @return 进度节点
     */
    @Override
    public PlanNode selectPlanNodeById(Long id)
    {
        return planNodeMapper.selectPlanNodeById(id);
    }

    /**
     * 查询进度节点列表
     * 
     * @param planNode 进度节点
     * @return 进度节点
     */
    @Override
    public List<PlanNode> selectPlanNodeList(PlanNode planNode)
    {
        return planNodeMapper.selectPlanNodeList(planNode);
    }

    /**
     * 新增进度节点
     * 
     * @param planNode 进度节点
     * @return 结果
     */
    @Override
    public int insertPlanNode(PlanNode planNode)
    {
        planNode.setCreateTime(DateUtils.getNowDate());
        return planNodeMapper.insertPlanNode(planNode);
    }

    /**
     * 修改进度节点
     * 
     * @param planNode 进度节点
     * @return 结果
     */
    @Override
    public int updatePlanNode(PlanNode planNode)
    {
        planNode.setUpdateTime(DateUtils.getNowDate());
        return planNodeMapper.updatePlanNode(planNode);
    }

    /**
     * 批量删除进度节点
     * 
     * @param ids 需要删除的进度节点主键
     * @return 结果
     */
    @Override
    public int deletePlanNodeByIds(Long[] ids)
    {
        return planNodeMapper.deletePlanNodeByIds(ids);
    }

    /**
     * 删除进度节点信息
     * 
     * @param id 进度节点主键
     * @return 结果
     */
    @Override
    public int deletePlanNodeById(Long id)
    {
        return planNodeMapper.deletePlanNodeById(id);
    }
}
